UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w8ed2s3tZ73ggJ7+27ELZu7xdpvhUY9fd18CqWB6GuE='
WHERE
key_id = '634a62cc9e4733bc0bcb5b43fe7c13d40c3a3a35ed52bbf73a8e88375e8d2912'
AND (
token = 'w8ed2s3tZ73ggJ7+27ELZu7xdpvhUY9fd18CqWB6GuE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)