UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vNgNCM6MTweNzmXHFADfxkBNxTq1zy4ron5vHSV41Cs='
WHERE
key_id = '095e1cf5cc6ef4c1c8cdaa3e3d4770a7048b471ee84b8413838dcd12b0a00a7c'
AND (
token = 'vNgNCM6MTweNzmXHFADfxkBNxTq1zy4ron5vHSV41Cs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)