UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2UAoE01QC6qk13VlsfrLZhqSszJ4/qPdR4cQB3jk6qo=' 
WHERE 
  key_id = '4243b7a8adea6140486f93b65fb71d1266684d2ca1562270b0400eecfdb39e5b' 
  AND (
    token = '2UAoE01QC6qk13VlsfrLZhqSszJ4/qPdR4cQB3jk6qo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024