UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JD92sw3R1IEg4PMY3Tc1sIJXGrDx9ei46I7rX5R0Fzs='
WHERE
key_id = '66e4f279228fc54526b17a5a5defea980e95f13b54da81e7ed0b92241ce02df3'
AND (
token = 'JD92sw3R1IEg4PMY3Tc1sIJXGrDx9ei46I7rX5R0Fzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)