UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/5JIkB+1JK1HRvYdJLX5DCvR8gdvoqtBPpgD5oft8cQ='
WHERE
key_id = '5da1ec856578358728cf14e57d667a8b6f8bbf4dc1afd25a1f2c1e71e37397e0'
AND (
token = '/5JIkB+1JK1HRvYdJLX5DCvR8gdvoqtBPpgD5oft8cQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)