UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2qH2O3QYESJnvWIJPmgQrrfAYPpBD3ioY3VqYzyV7Dg='
WHERE
key_id = '5b51853a5a72c07d24da6e59e5557299464ecc6182ae2fb2a24f38c7c0cc70b6'
AND (
token = '2qH2O3QYESJnvWIJPmgQrrfAYPpBD3ioY3VqYzyV7Dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)