UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KLeGN/WquQWb726434sIu6RwTH9TLGZ93pcCGbfoJPQ=' 
WHERE 
  key_id = '0f9c053423fbd1c3939c399e283078e8caef2a037b6e94fe7846da7f125b9dc5' 
  AND (
    token = 'KLeGN/WquQWb726434sIu6RwTH9TLGZ93pcCGbfoJPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033