UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MXquXgGoYq26ULRK7n3U8sbHshcRC/yDQnP2WATK2S8='
WHERE
key_id = '05d29c775641e8239bbe9363201499600d51a848595da1a089c07b17eab30ce9'
AND (
token = 'MXquXgGoYq26ULRK7n3U8sbHshcRC/yDQnP2WATK2S8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)