UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ItHiYImnxVkB8BGCAFf9KD3484L8hoUhrQ0nE0Y82KI=' 
WHERE 
  key_id = '55388b6ea57058391b7324005d84996447f9ca87a13d33ff50e8e1c87264322d' 
  AND (
    token = 'ItHiYImnxVkB8BGCAFf9KD3484L8hoUhrQ0nE0Y82KI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058