UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3JcGmKAkm3WqzEUzuZk1IZHjmdH2dUotXp5W3qV3Xig='
WHERE
key_id = 'cb5914b9606a705f7f18658db6c617e88dcb4d269b75374aa2dddfd7ef09fa31'
AND (
token = '3JcGmKAkm3WqzEUzuZk1IZHjmdH2dUotXp5W3qV3Xig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)