UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fUAwCfMVre6E5zhIChDJ603uX/BAP03A/h6sRxM2Elw='
WHERE
key_id = 'e3edcff94f1f22124e8c4d87c6f4bff764fc67cb2ced0246138121cd4efffa3b'
AND (
token = 'fUAwCfMVre6E5zhIChDJ603uX/BAP03A/h6sRxM2Elw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)