UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qZPVSZ4moU/EKPFz/pdmvI0Dq0Q2rfQ64gd1GUF5ZHg=' 
WHERE 
  key_id = '4be51bc8a40f940c9b2ec35944dfce73a022d1a04af1fc9d02108d03da8c8ac1' 
  AND (
    token = 'qZPVSZ4moU/EKPFz/pdmvI0Dq0Q2rfQ64gd1GUF5ZHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017