UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c7iNDkSPkXM4zfDJ/0kvzPqjV9W7xdzgwJuJmgyvnv4='
WHERE
key_id = '455cdfcb797e4b270d18fc59d9ea44aa85ca4f0a04b6d699179f0df42fa0841d'
AND (
token = 'c7iNDkSPkXM4zfDJ/0kvzPqjV9W7xdzgwJuJmgyvnv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)