UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZMcgx5QR48grah1LdmJWthm2MKL38O5XFRLzske2Njw=' 
WHERE 
  key_id = '06432efce8e909f89c2096a7ad84b00cd5ce9d511029cf8003f848e2ec6350d2' 
  AND (
    token = 'ZMcgx5QR48grah1LdmJWthm2MKL38O5XFRLzske2Njw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032