UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WncsXlNuQU9nd3AlqKZSsc5dfomopNmJFu4TxcvLrQs='
WHERE
key_id = '139598ccbab12acb05f68de0b8034090fe08e6f30eee54ec5f0c024ad951cc4f'
AND (
token = 'WncsXlNuQU9nd3AlqKZSsc5dfomopNmJFu4TxcvLrQs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)