UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F2OCMpLQZig/KujLRMNE9zclT6AK5DS40zUsuBCZJzE=' 
WHERE 
  key_id = '4707c70073a3d452a896d1d1e9920585f3b8cdd76d1062df7e41a02056c27559' 
  AND (
    token = 'F2OCMpLQZig/KujLRMNE9zclT6AK5DS40zUsuBCZJzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019