UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DFsphwkQSeq24lU0W1jy+YYxhvtL2fhdo9Wjewowq4Q='
WHERE
key_id = '287c97777987ebd39c783089b7d78a4e1970128b4c9009854bf687683f32816b'
AND (
token = 'DFsphwkQSeq24lU0W1jy+YYxhvtL2fhdo9Wjewowq4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)