UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Ca/PcsoYKWtHL65TNvciXau4oQlPc2EFHwflgxGddQ='
WHERE
key_id = '07fce1897c550bea42e4cb009f8fe5d14777ca15c4245f6eb71f67b6c14f26db'
AND (
token = '2Ca/PcsoYKWtHL65TNvciXau4oQlPc2EFHwflgxGddQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)