UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IURtkyZvTbuyqSUP/PPP6OQiQCysqCCmYB0rWCg7vTA='
WHERE
key_id = '2f83eabab8ae7088069c83c32c1e48689a4446a1885c05a87c89b3b60c80894c'
AND (
token = 'IURtkyZvTbuyqSUP/PPP6OQiQCysqCCmYB0rWCg7vTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)