UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tHH2lLlZu4BUR1QUayh8juP+QUPEIr7KIfjec01HGto=' 
WHERE 
  key_id = '05e00ae3592b63cf01d28ed49fce3bfd4b6eb5d67b79653a9ac24408f40fe916' 
  AND (
    token = 'tHH2lLlZu4BUR1QUayh8juP+QUPEIr7KIfjec01HGto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041