UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ipiu3c8cW4LMP0OO+o6x8h30TqHTstLyeIEqt1QkAkw='
WHERE
key_id = '463c23b36d66c25cb662e4455daab72565e9f12417ba4ae54939854ccb532c41'
AND (
token = 'ipiu3c8cW4LMP0OO+o6x8h30TqHTstLyeIEqt1QkAkw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)