UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YT/NmEj6g1GMcrUdJJwoEkjU5whVRBL5hWz1/9Tfehw='
WHERE
key_id = '8e43344d67029dd81bc836ffbc125e778ef3b1303316822385c0ae0c29c8c45f'
AND (
token = 'YT/NmEj6g1GMcrUdJJwoEkjU5whVRBL5hWz1/9Tfehw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)