UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '70oq4vo2Cl6wjtFupFVmQ12t11gAo29h1jkDnBiAVfg=' 
WHERE 
  key_id = '6e2e60b3f05c3592dcb443f59c37484bd919f67ba8211b28e00aab54c7961706' 
  AND (
    token = '70oq4vo2Cl6wjtFupFVmQ12t11gAo29h1jkDnBiAVfg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036