UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0heX8Bn6ymzEsmNj+BLlfZuzPeZMDFEwAm7N1A/Y7/w='
WHERE
key_id = '7a6aeaeeb1c2974729cbb050308f2d757d4bfe185d3d1f8cec74ed53e34a68e6'
AND (
token = '0heX8Bn6ymzEsmNj+BLlfZuzPeZMDFEwAm7N1A/Y7/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)