UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TlEwbnrjbeHZnxRghrsnv2jNUCKHLNRF4oBz36MUjRA='
WHERE
key_id = '1d0dff505b441d4e62e34896ff2143238a9092fee9e5ed513fce4536183b1b31'
AND (
token = 'TlEwbnrjbeHZnxRghrsnv2jNUCKHLNRF4oBz36MUjRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)