UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YEKMI4Us5BFXl83iyDyXZ72oP4h+Fit732dKN6Uos1o='
WHERE
key_id = 'c479925fd9a1d372b5aaa07c3c0e516bf9ca26ff1111a54b65489d12d09a7a88'
AND (
token = 'YEKMI4Us5BFXl83iyDyXZ72oP4h+Fit732dKN6Uos1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)