UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'imCXoZO7ZEXQLfltVnNoi1K5YtmMVuwyCgMgQ5TSJ4o='
WHERE
key_id = 'a60df8a31ba209f1e4876fe70886b0bdc96b74f3f4f72cb0fd88b420ab988d39'
AND (
token = 'imCXoZO7ZEXQLfltVnNoi1K5YtmMVuwyCgMgQ5TSJ4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)