UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9fsHtjnRET6AIZL+ykHZ/2dMery52H4f/6El/Y3yAeE='
WHERE
key_id = '484b9dddb17c753bfb394ffd777464c8730481099b8bf63ab6abaaf19232b029'
AND (
token = '9fsHtjnRET6AIZL+ykHZ/2dMery52H4f/6El/Y3yAeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)