UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iuaybUHAXYQpHfdr0pM+FMxLHMaJMmoLiqhR9PuuM9g='
WHERE
key_id = '377ad3999e7c61b0d0b4533e6c3086e152592199fccb0d7442f24a799cf49d1d'
AND (
token = 'iuaybUHAXYQpHfdr0pM+FMxLHMaJMmoLiqhR9PuuM9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)